Engine
Properties
The application context of the android app.
Returns the base uri of the default asset sources that was previously passed to addDefaultAssetSources.
Coroutine dispatcher of the Engine thread. It is always main thread coroutine dispatcher for public usage.
Set this flag as true if you want the Engine to become idle if it has no pending work. This is useful for UI testing, as Espresso expects UI thread to become idle before making any assertions (without this flag your UI tests will always be stuck as main thread is never idle due to the never ending Engine update calls). Default value is false. Note that the flag is experimental and might be changed/removed.
Hides the floating text-selection ActionMode window.
Functions
Convenience function that registers a set of asset sources containing our example assets. Note: See DefaultAssetSource enum for available values. Note: By default, these assets are parsed from the IMG.LY CDN at https://cdn.img.ly/packages/imgly/cesdk-android/<version>/assets/<id>/content.json.
Convenience function that registers a set of demo asset sources containing our example assets. Note: See DemoAssetSource enum for available values. Note: By default, these assets are parsed from the IMG.LY CDN at https://cdn.img.ly/packages/imgly/cesdk-android/<version>/assets/<id>/content.json.
Registers a new listener that is invoked every time bound SurfaceView's or TextureView's Surface is created/recreated. This, for instance, can be used to update the android.graphics.SurfaceTexture instance in BlockApi.setNativePixelBuffer.
Binds surfaceHolder to the Engine. All rendered frames will be drawn into the surface of surfaceHolder. Note that only one engine instance can be bound at a time. Calling bindSurfaceHolder unbinds other engine instances.
Binds surfaceView to the Engine. All rendered frames will be drawn into the surfaceView. Note that only one engine instance can be bound at a time. Calling bindSurfaceView unbinds other engine instances.
Binds textureView to the Engine. All rendered frames will be drawn into the textureView. Note that only one engine instance can be bound at a time. Calling bindTextureView unbinds other engine instances.
Returns all the keypath-value setting pairs of the Engine. Useful when copying settings between Engine instances (see importSettings).
Sets all the keypath-value setting pairs to the Engine. Useful when copying settings between Engine instances (see exportSettings).
Tells whether the engine is bound. The engine is being in bound state in between one of bound and unbind function invocations.
Tells whether the engine is currently running.
Pauses the current engine. All the resources of the engine will remain in the memory, however the engine will not consume any processing power. Call unpause to revert the effect. This method is useful when you want to save processing power resources when the engine is inactive in your current UI. It is also useful, when you have multiple engine instances: we highly recommend that you always keep 1 active engine at a time. When switching the current active engine, call pause on the remaining engine instances.
Creates and adds a new local asset source with id. A describing content json file is fetched from jsonUri and containing assets are added to the local asset source. Note: Check "https://cdn.img.ly/packages/imgly/cesdk-android/1.81.0/assets/ly.img.sticker/content.json" for the structure of the json file.
Unregisters listener that was previously registered via addSurfaceCreatedListener.
Starts the Engine. After this invocation all the APIs can be used. The opposite of this method is stop. Note that other than userId we also use the android.provider.Settings.Secure.ANDROID_ID for better data accuracy. You should include it in the Data safety form of your application when uploading it to the Play Store.
Stops the engine. All the native resources will be released and scene will not be available anymore. All subsequent calls to any of the APIs will result to thrown exceptions. In order to use Engine again, start should be invoked. This method also invokes unbind if necessary. Note that after calling stop other Engine instances that have the same id will crash upon any usage.
Releases the surface buffers and clears the reference of SurfaceView if bindTextureView was called or of TextureView if bindTextureView was called.
Unpauses the current engine that was paused before via pause.